The reaction given is:
4Ga + P4 ---> 4GaP
The oxidation number of the reactants is zero, because they are pure elements.
The P in compounds may have oxidation states 3- or 5-. Gallium may only have oxidation state 3+.
Then, to be neutral in GaP the oxidation states are 3+ for Ga and 3- for P.
And the transference of electrons can be see in this oxidation - reduction equations:
Ga (0) - 3 e- ----> Ga (3+)
P (0) + 3e- ---> P (3-)
So, for one formula unit, 3 electrons have been transfered from each Ga atom to P atom to form one GaP unit.
Answer: 3 electrons.