Galvanized diamond lath is fastened to the sheathing and or studs behind the foam board using galvanized roofing or aluminum siding nails.
Galvanized lath is designed to be installed horizontally so that the laths will grip the base coat.
Unless your foam board is specifically designed as a backer for stucco applications, you may also still need to install stucco grade housewrap or 15#felt paper as a water barrier between the foam and the diamond lath.