Deformation method for electromagnetic magnetospheric fields: 2. Application to the Earth's magnetosphere