There's all kinds of fancy pipe supports out there, pick a good'n. Make sure the 2x is screwed/nailed solidly to the studs and then anchor the pipe to the 2x. Might need additional 2x's depending on the location of the existing one. I'd also support the pipe running vertically up to the valve from the floor by screwing another 2x to the studs about half way up.
Based on your photo above, you'll also anchor the finished shower head riser pipe to the tile surface. That finish support will likely have a screw(s) that will go thru the tile into another chunk of 2x in the wall. So, figure out where this anchor will be and make sure there's some solid 2x in the wall to hit with those screws. A wider 2x will make for a bigger target, so I typically use 2x10 or 2x12 for that sort of thing.