How do you secure pre-built garage shelving to the frame?
I'd go two screws per wall stud thru the top and middle shelf. The weight of the thing is supported by the structure itself so all you need to do is keep it from falling over. Use a 4 1/2 inch timber tech or a 5/16 lag with a washer and you'll have two inches of screw into the stud which is adequate but a minimum. Make sure you install shims or a spacer to fill that gap before you run your screws.