The transfer switch has two input and one output.
Remove the cable from the MSH3012 output and connect the cable to the new transfer switch output.
Remove the cable from the MSH3012 input and connect this cable to the normally closed input of the new transfer switch.
Get new wire and connect the output from the MSH3012 to the normally open input on the new transfer switch.
You will have no utility power going into the MSH3012 so the inverter will not charge the battery. But I think that was part of the original issue. Get a separate battery charger rated for the local voltage. This charger needs to draw power before the transfer switch or you will have a power loop with the inverter. Or manually plug it in when the inverter is off.