How chiral forces shape neutron-rich Ne and Mg nuclei