A transformer operates on the principle of electromagnetic induction with alternating current (AC). The primary coil is connected to an AC source, which creates a varying magnetic field in the core. This changing magnetic field induces an AC voltage in the secondary coil. The frequency of the alternating current and voltage is determined by the source and does not change as it passes through the transformer.