During the formation of NaCl, transfer of electron is from X orbital of Na to the Y orbital of Cl. Then X and Y are respectively:
In writing the electron configuration for sodium the first two electrons will go in the 1s orbital. Since 1s can only hold two electrons the next 2 electrons for sodium go in the 2s orbital. The next six electrons will go in the 2p orbital. The p orbital can hold up to six electrons. We'll put six in the 2p orbital and then put the remaining electron in the 3s. Therefore the sodium electron configuration will be 1s22s22p63s1
In writing the electron configuration for Chlorine the first two electrons will go in the 1s orbital. Since 1s can only hold two electrons the next 2 electrons for Chlorine go in the 2s orbital. The next six electrons will go in the 2p orbital. The p orbital can hold up to six electrons. We'll put six in the 2p orbital and then put the next two electrons in the 3s. Since the 3s if now full we'll move to the 3p where we'll place the remaining five electrons. Therefore the Chlorine electron configuration will be 1s22s22p23s23p5