Ideally, if using a non-marine charger, as well as the positive you need to disconnect the battery negative from the engine and equipment because the engine will be ground to the sea and the charger will also have a ground connection. The chance of them being at the same potential is small so a current will flow between them and, according to Sod's law, there may (will) be errosion of some part of your equipment, probably the engine or its anodes. Remember, mains neutral is strapped to mains earth so even if you use a double insulated type of product there is still a ground connection. And, depending where (physically) it is strapped to earth and the other equipment in the vicinity which is connected to the mains, there is already likely to be a potential difference between the neutral and the sea (as earth).
Having said all that, a few months ago I bought a new 16amp auto charger sold under the Ring brand and it has proved to be excellent. It pumps the battery up very quickly and looks after it too. I also have a small Ring charger which is automatic but its maximum current is 4amps and on a largish battery it gets confused and just keeps charging at 4amps rather than shutting down to a trickle.
Neither of these have been used to charge batteries while at sea so it's purely a comment about the chargers.