Neutron-rich N=22, 24, 26 magnesium isotopes were studied via in-beam γ-ray spectroscopy at the RIKEN Radioactive Isotope Beam Factory following secondary fragmentation reactions on a carbon target at ≈200 MeV/nucleon. In the one- and two-proton removal channels from 39Al and 40Si beams, two distinct γ-ray transitions were observed in 38Mg, while in the one-proton removal reaction from 37Al a new transition was observed in addition to the known 2(1)(+)→0(g.s.)(+) decay. From the experimental systematics and comparison to theoretical predictions it is concluded that the transitions belong to the 2(1)(+)→0(g.s.)(+) and 4(1)(+)→2(1)(+) decays in 36Mg and 38Mg, respectively. For 34Mg, previously reported 2(1)(+) and 4(1)(+) level energies were remeasured. The deduced E(4(1)(+))/E(2(1)(+)) ratios for 34,36,38Mg of 3.14(5), 3.07(5), and 3.07(5) are almost identical and suggest the emergence of a large area of deformation extending from the N=20 to the N=28 shell quenching.