... a friend of mine mentioned that there might be some dangerous static build up on the generator if it wasn't properly grounded.
"Dangerous static build-up?" Can't say as I've heard of that before.
There's really nothing "magic" about a portable generator. They're the same technology that the power company uses. They're the same technology that's been used to generate power ever since Tesla and Westinghouse.
Is this true, and if so, is there a way I could go about grounding it through the keel somehow (d/c wiring?)
How are you going to use this generator? If you're going to be using it with your boat's electrical system, I would imagine you're going to use your shore power connection. If so: Everything should
be grounded, as well as it can be in water, anyway, sufficiently. If it's not: Your boat is mis-wired.
As NautiG cautions: Even the "quietest" portable generators are pretty damn noisy and they generate a significant
amount of exhaust gases, incl. carbon monoxide. You're going to want CO detectors in encloses spaces.