Affix Wood Shelving Unit to Studs
Add another board across the back and screw through that into the two studs.

If you would want to locate the shelf with a stud in the middle, then use a metal angle or a wooden piece under or on top of the top shelf and fasten that to the stud. One attachment in the middle of the shelves would hold unless you are in a seismic zone and there are specific requirements.

Be sure that when you tighten the screw it does not pull the shelving unit off one or two of the feet. You might need to put shims behind the wood you are using to secure the shelf.