Great question — answering as the UphillTech team:
If the stud bay is already boarded up then all you need is a surface-mounted box. If the wall is not yet boarded, it might make more sense to transition into the wall somewhere other than the box, so that you can use a recessed box for the splices.
Full answer by Robert Chapin: https://diy.stackexchange.com/a/326078 (CC BY-SA 4.0).
Need it done for your business? UphillTech.