I do both depending on how I feel. When I mash I do it out of the saddle and it feels good to stretch. I usually do this on shallower climbs where I am moving pretty quickly. If it's really steep or I'm tired I spin. For years I was riding a road bike with a low gear of 34x26. That was enough to get me up the steepest hills round these parts. When I got a gravel bike with a low gear of 42x42 I never thought I could possibly use that. As it turns out I've found a couple of hills that I use it on. I could walk up that hill faster but I feel a lot better when I get to the top!