From the Hoye Tractor site:
Your Yanmar tractor not keeping the battetry charged? Chances are the regulator is bad. Yanmar uses an extremely reliable "generator" unit that, unfortunately, uses an unreliable external regulator.
To test the generator you need to use an AC (like a house voltage, not a car) volt meter. Locate the two wires coming out of the generator and follow them to a small plug. After disconnecting the plug, hook the ground wire from the meter to one wire and the posative to the other (it doesnt matter wich one). With the tractor running at a medium idle, you should have either 14VAC or 40VAC (+-). If it is anywhere close your generator is OK. If your generator is broken you will not get any voltage at all.
Check to be sure that all of the wires look OK from the generator to the regulator and also to the battery. If all of these are OK, your voltage regulator has likely burned out. There is no way to repair these units. You can find replacement regulators here.