There are voltage controlled "battery combiners" specifically made for this. They sense voltage above the fully charged battery (usually around 13.1V) and close a relay when it is exceeded, indicating that something is charging the system. This has the advantage of not needing a connection to the ignition, not connecting if the ignition is left on but the engine is not running, and a contactor specifically designed for continuous high current. They cost a little more than a simple relay though. Search Amazon or your favorite marine supplier for "battery combiner".