"Old Work" electrical box: should it be screwed into the stud?
Junction boxes are not to have additional holes drilled into them for securing them to studs. The box you have shown can be used and mounted fairly secure if you take the time to cut the opening as small as possible so the box tabs have more drywall to support it.
A better solution is to get a box similar to the one below with side screws already included to be mounted to the stud. This is the same size as the old work box but allows you to screw directly into the stud.

Southwire Smart Box 2-Gang Adjustable Depth Device Box #MSB2G