I am refinishing a room that had a gang of light switches mounted directly to the lath, between the studs. The lath is out, and drywall is going up next. I don't wish to change the horizontal position of the box, and I would like to avoid changing the box itself. I would like to know if there is a particular bracket I should mount the box to that stretches between the studs, or if I can just stretch a piece of scrap wood between the studs and mount the box to that (which seems technically comparable to mounting to lath, in my opinion).
The common method for dealing with this situation is to cut a piece of material that is nominally the same type of material as the studs and nail it between the studs as blocking. The electrical box is in turn mounted to the added cross piece.
Here is a picture of what one such blocking insert looks like (also known as header or noggin).