Well, there goes THAT theory. It was electrical, by the way.
This sounds like a fuel problem. It takes far less fuel flow to rev the engine on the trailer because it's under essentially no load. That works fine. It takes far more fuel flow to rev the engine in the water because the impeller is moving water all the time and the engine is loaded. That doesn't work. The big difference is in the amount of fuel required; and when the engine has a load but is starved for fuel, it does what engines do when they're starved for fuel - it sputters and stops.
You said compression is good. The engine starts quickly, which doesn't require much fuel flow but does require lots of other things to be working properly. Everything points to fuel flow IMO.
Time to think about the fuel system. Did the boat sit for a long time before you bought it? Could fuel have sat in the fuel system, deteriorated over time, and gummed things up? That could restrict fuel flow in a number of places: Needle/Seat, VST, HPFP filter, pressure regulator filter, injectors, HP fuel lines....
Grab the manual (available on this site, I'm told) and run some of the fuel system tests. They're not difficult, require only basic tools, and will reveal a LOT.
Also, when you said you had "checked the battery", did you actually put a digital voltmeter on it while the engine was running? A battery under no load will usually read plenty of voltage. What matters is what it does under load. That earlier response that mentioned the battery was correct - and you should confirm proper voltage while the engine is running with a DVM. (Available at Harbor Freight for under $5.)
There's several things for you to check. Report back!