I’ve made three wires to attach to the microswitch – red and black are the inputs and yellow is the output. When the switch is open, the yellow wire will be one polarity and when closed it will be the other. If it’s the wrong way around, I’ll simply swap the black and red wires (which are thankfully the easiest two to get to)
The black and red wires take their input from the DCC bus. The yellow wire will go to one of the frogs on the three-way turnout.
To determine which wire goes where, I drew a diagram which showed all the parts and then calculated the frog polarities. Each of the frogs is powered from one microswitch.