Transformers are typically labeled with their primary and secondary windings. If the transformer is not labeled, you can test it by disconnecting the wires and checking for continuity between each wire and the transformer case. If there is continuity, the transformer is primary; if there is no continuity, the transformer is secondary.