Can I install a subpanel on top of boards instead of of between studs?
You may notice that the panel has knockout holes all along both sides.  Mounting them in the void between joists is not a requirement, and those side knockouts are for when you surface mount the box.  

Generally in that situation, you mount the service panel on a sheet of plywood somewhat larger than the panel.  Leave yourself room for externally mounted things like the electrician's outlet, whole house surge suppressors, power monitors, datacomm, etc. 

I'm not sure about mounting it to a couple sticks of 2x4.  Certainly if you finish the basement later, it's a lot easier to mate up drywall to a sheet of plywood to make it presentable, rather than a couple 2x4s.  

Since this is a "best practice" done almost universally, needless to say, I recommend doing it.