Application of the density-wave theory to the spiral structure of the Milky Way system. III - Magnetic field - Large-scale hydromagnetic shock formation