Boat shore power alternative

Hi all, just want to get some thougths on a possible setup. I have a motorpowered 42 feet boat. Can I install an AC300+b300 in the engine compartment (this is ventilated) and connect the AC300 permanently on a splitter after the wall power socket? So when there is no shore power available, I can directly use the AC300 as an alternative?

@Juul1977 Welcome to the community

@Juul1977 This requires the use of a transfer switch.