Glycolysis - ATP production
The other two phosphates come from inorganic phosphate* in solution (Pi — in my diagram below) at the glyceraldehyde phosphate dehydrogenase stage. (Two, of course, because there are two molecules of triose.)



This is covered in Berg et al. Section 16.1.5.

*The term inorganic phosphate is used because there are various different anions in solution derived from phosphoric acid, depending on the pH. At physiological pH the predominant species is the double-negativly charged, monohydrogen phosphate.