Get a wiring diagram for your specific model and serial number machine from the Scag website under manuals. Some machines are wired differently so a wiring diagram is necessary.
Generally, the regulator output passes thru the engine harness to the machine harness, a fuse, and then to the key switch, usually in a yellow wire. At the key switch when in the on position, the circuit is completed and then goes back thru the machine harness, again thru the engine harness now in a red wire, and connects to the battery positive cable on the start solenoid.
This is a half wave type charging system and when the engine is not running and the key switch is in the off position, the system is isolated from the battery to prevent back feed. When the engine is running, the charging system needs to have a a complete circuit back to the battery, and if not then components like the regulator/rectifier will burn up.
So you need to trace and check each component/connection in the charging system from a good starting point. Bear in mind also that the system ground needs to be a good connection. This is usually done at one of the engine mounting bolts along with the battery negative cable and other grounding connections.