A handy new Transform > Warp > Cylinder option was added in the last update. It only works when the cyclinder shhape is square on to you, and it does not have have enough control to do a surface as near to flat as the hat below, but it's a tool I think I'll be making a lot of use of.
With the moree difficult perspective in your example image, you would still use Transform > Warp, but in this case you would chose Arch. You need to make the Type layer a Smart Object (some of the warp options are not available for Type layers otherwise). Arch will let you follow the curve of the hat, but you will need to Skew the layer (Hold down the Cntrl key and drag a center end handle). You will also need to give it a slight perspective (Ctrl drag the top corner handles inward).