If replacing the TSM doesn't fix the problem with erratic tacho indications and engine cutting out, it may do as it does a lot of strange things, I would have a look at the Crank Position Sensor as that feeds an engine speed and position signal into the ECU for ignition and tacho indication. Bunny also does a replacement one of those at a very reasonable price 😊.