Black is wheels, red is center track roller, white and yellow are the motor leads.
On the locomotive, the motor leads are the outside pins, the wheels (frame) is usually shorted directly to the frame at the connector, and the remaining connection goes to the center track roller.