Transfer of learning from mechanics to electricity and magnetism