How is electromagnetic induction applied to generators and transformers?