http://www.kohlerengines.com/manuals/en ... cation.htm
Above link to Kohler web site has the engine identification location. Use the same site, click on manuals to down load a service manual for your engine.
Edit: If the engine charging system worked before installation into your lawn tractor then the problem is more than likely in the manner in which it is wired up. I have a Kohler Command series engine. There are 6 or 7 wires from the engine to the ignition switch. Before I could put the engine in service I had to trace, label, and record each of the wires to their source. Then diagram/sketch switch terminals, test, record, and figure out how the ignition switch functioned at each switch terminal.
All of this was with the service manual's wiring diagram in hand.
Once I knew and understood where each wire went and it function and the switches function at each terminal - I could connect the engine wires to the switch. I did have to jumper two terminals on the switch to get everything to work properly.
The service manual for your engine will have wiring diagrams and diagnostic test for the charging system.
All switches do not function alike even is they have the same number of connection terminals. If you used the switch from the 582 it's internal switching function will more than likey not work correctly for the Kohler engine.