Fuel filter, fuel strainer in tank.
DEFINITELY CHECK THIS !
My one year old Yanmar was doing the same thing.....would simply quit intermittenly for no apparent reason. Dealer replaced the fuel shut off solenoid twice, then started looked at all the safety switches....seat, PTO, neutral ( gear drive w/shuttle ), parking brake......
TURNS OUT, it was some plastic drill shavings (probably from drilling the tank at the factory to install the line fittings...supply and return ) in the fuel tank that would roll around and block the outlet line from time to time ( like a marble in the tank ). They just happened to notice, as it quit once in their shop, the plastic fuel filter bowl caving inward as the fuel pump, starved for fuel, was sucking all it could.
Pulled the supply line off the tank, only a dribble of fuel.....stuck a long, thin screwdriver up in the fitting, and got drenched with fuel as it moved the obstruction out of the way.
The fact you can stop yours from dying by backing off the HST pedal, or pushing in the clutch, says reducing the load ( and fuel requirements ) allows it to still run. Sounds a lot like lack of proper amount of fuel. Worth checking BEFORE it drives you nuts !