You could also have a bad wire or bad wire connection in your ignition circuit. Check the ground wire specifically at the ignition solenoid.
Guessing that you have a Cummins mechanical 5.9L engine, after the engine starts the loss of electricity releases the fuel shutdown solenoid arm and closes the throttle.
To keep the engine running in an emergency, you could wire the fuel solenoid in an up position and the engine should keep running as long as the alternator charges the chassis battery. You probably then will not have key guages to manage your rig available.
However, if the transmission will not operate while the engine is running, then I would for sure look at the ignition solenoid as the culprit not passing the electrical current to the dash or the tranny pad.
If you have a 5.9L ISB engine then perhaps the above has some value, but I am not sure.
1995 CC Magna #5280
C8.3L 300hp Cummins, 31,000lbs