Something like a VSR would do nicely. We have one that connects when the engine
is running (over 13.7v) and cuts out (below 12.8v) when the engine
stops. There is a slight delay in the VSR cutting out as the batteries hold a surface charge and the voltage up for a little while but that is fine.
This link is for a UK manufacturer but there will be the equivalent near you.
A VSR can also be combined with battery
switches in a neat module if you need it which is what we did when the rotary 1/2/off switch failed though age.