Show the formation of MgO by the transfer of electrons in the two elements

Show the formation of MgO by the transfer of electrons in the two elements using electron dot structures
Or
Atomic number of Mg is 12 and of oxygen is 8. Show the formation of MgO from its elements.
Or
Using the electronic configurations, explain how magnesium atom combines with oxygen atom to form magnesium oxide by transfer of electrons.

Magnesium (Mg) loses two electrons from its outermost shell and becomes Mg2+, while oxygen(O) gains two electrons to become O2- .