Working as a marine electrician this is a common task I undertake.
The easyest way ive found is to use a VSR (voltage sensitive relay)
The Voltage Sensitive Relay (VSR) allows two batteries to be charged at the same time. When the engine is started and the start battery reaches 13.7 volts, the VSR engages, allowing two battery banks (start and aux) to be charged simultaneously. When the voltage drops below 12.8 volts (eg the engine is stopped), the VSR disengages, separating the batteries. This system eliminates the possibility of draining the start battery and protects sensitive electronic equipment powered from the house battery from harmful engine start up spikes.
Always ensure cables are sized correctly as undersized cables cause voltage drop and in extreme cases FIRES.
Always install a fuse at either end of the VSR as close to the battery as possible.
Ensure cables are protected from chaffing.