You would need something like what we used to call a Pierce governor to control the speed.
http://www.foleyengines.com/resourc.../hoofpierce-governor-instructional-guideJust pulling out the throttle would not control the speed close enough. Tractors have something similar to what we used to call a Pierce governor. I once rigged a 248 GMC engine with a pierce governor to use on a pneumatic blower. Even though the water temp stayed under 180, the exhaust temperature got so hot that the exhaust manifold crumbled. I have a DG6E Baldor Diesel generator that I use for power tools. I have a Miller Trailblazer 440 with a 4 cylinder Perkins that I use for heavier current. I think if you want a generator you just buy one. I don't like gasoline driven ones because the gas is usually stale when you need them. A tractor can be set at a constant 540 PTO RPM, but you would need something like a Pierce governor on your truck and then disconnect it when you want to drive.