How a Transformer Works