Greetings and welcome aboard the CF, Joseph.
The generator neutral shall be grounded at the generator. (See DIAGRAM 2 or DIAGRAM 4.)
For boats without isolation transformers, to comply with the above requirements in the case of the on-board generator, a very specifically engineered source transfer switch is required. That switch transfers the boat’s AC electrical
distribution panel between either 1) off-the-boat shore power
as the source of AC power or 2) the on-board generator (genset) as the source of AC power. That switch must be of a double-pole, break-before-make design. That switch design transfers BOTH the hot and the neutral wires of the boat’s AC electrical system
When the switch is in the “shore power” position, the on-board neutral and the safety ground are bonded together ashore, but NOT connected together on-board the boat.
When the switch is in the “generator” position, the on-board neutral and the safety ground ARE bonded together at the frame of the genset. Remember, the genset, when in operation and switched online, is the “derived source” of the boat’s AC power.
Realize that in that state, the incoming shore power
neutral is not connected to the boat’s operational AC electrical system
, even if the shore power cords are still connected to the dockside pedestal
. That is prevented by the break-before-make design of the Generator Transfer Switch.
FWIW: Portable generators are not generally approved for use aboard boats.