It plugs onto the four pins on the motor-block.. It will come with the instructions.
You do need to screw it to the weight, in the loco / tender. - To get rid of heat.
BOTH motors would need to be fed from the unit (I am assuming both tender and loco have motors, not so for all versions). - You may have to be 'creative' with the wiring between loco and tender? - As I say, depends on the version you have.