"Consider that the actual output from the plates (pin #3) of each output tube is a very high DC voltage (400 - 500 VDC depending on the amp). Riding on this high DC voltage is the audio signal which is a small AC voltage. You don't want that high DC voltage to go directly to the speakers because the high DC voltage would destroy the speakers. What you do is run the high DC voltage and the small AC audio signal from each output tube into your output transformer. The output transformer has two windings - a primary winding where the voltages come in from the output tubes and a secondary winding that connects to your speakers. Since transformers only transfer AC, they are very effective at blocking DC voltages. What goes in on the primary side of the transformer is your high DC voltage with the AC audio signal riding with it. What comes out on the secondary side is just the AC audio signal. This is all done by electromagnetic INDUCTION. There is no electrical connection between the primary and secondary sides of an output transformer. The wires (primary and secondary) are just placed close together and the AC audio signal is "induced" or carried over to the secondary side."
Side note - There are some "OTL" (Output transformerless) tube amp designs out there that use either capacitors or other methods to block DC from getting to your speakers without the use of a transformer. So in reality, the output transformer is not absolutely "necessary" as long as you use some other method to block DC from reaching the speakers.