As mentioned, there will be a respectable amount of heat generated by a hydraulic pump/motor system. Years ago, we replaced the 5hp B&S engine driving the pump with a hydraulic pump/motor setup on the weed spray rig we slid into the back of the pickup every spring. The hyd oil tank got smokin hot after pumping 300gal of spray dope out - and remember this application was less than 5 HP. Our solution was to take a full joint of 1/2" steel pipe, bend it into a U and stick it into the water tank so that the spray solution picked up the heat from the oil return back to the hyd oil tank. Your idea will work, but you'll need a cooler.
One thing to keep in mind, though: Hydraulics are pretty good efficiency-wise until you get over 75 HP -- as compared to electric generator/motor drives. It doesn't sound like you're planning over 75 HP, so chalk up a "+" in the hydraulics column. But, hold on a minute! You want to produce electricity with this rig anyway, so why not just couple the generator straight onto the PTO and direct drive it? The afore mentioned heat is wasted energy that would now not be lost.
Problem with direct gear or belt driving the generator is that you would be forced to run the engine speed up high enough to drive the generator at 60 HZ, usually 1800 RPM for a 4-pole generator (typical). So now you've got your 850 HP Cummins wrapped up to 1800 RPM simply to drive a 13-20 HP load when it could easily pull that load at close to idle.
Now we're back to hydraulics, because then it would be easy to set your engine speed at a sensible RPM and then adjust the valving to, or displacement of, your hydraulic motor to spin the generator at the required 1800 RPM. Even with the energy losses in the oil cooler, you'd probably save fuel as compared to running the engine at the higher speed unloaded. A really fancy setup would set an aftermarket cruise control on the engine speed and another on the generator speed to keep both at a constant speed regardless of load. Just like anything else, you can do whatever you want if you've got enough $$$ to throw at it.
If you’re thinking about using belt sheave sizes to set your speed ratio for 1100-1200 engine RPM = 1800 generator RPM, consider whether it might be possible for the clutch to engage while your in the middle of your sled-pull run, ‘cause that will over-speed your generator with very exciting results (for the spectators, anyway)!
Bottom line is that the most cost effective solution is going to be to just buy an engine-driven generator. You'd be spending far more on a comparable powered hydraulic drive kit and all you'd have to do to set the stand-alone genny up is just to top off the lube and hit 'er with the fuel. Now if you’re trying to load down the Cummins by powering half your block, you’ll be needing a PTO driven generator that most folks would be hangin’ on the back of their tractor….