The layer transform tools will move the entire shape layer including any effects you apply like Gradient Ramp. If you applied Gradient ramp to a Shape layer and you use the Shape Object (path, polestar, etc.,) transform tools to move the shape on the layer then the Gradient Ramp will not move.
If, on the other hand, you have properly selected a gradient fill and the gradient start and end points are based on the shape and will move with the shape transform controls as well as the layer transform controls.
If you are experiencing something different then you need to send us a screenshot of your shape layer with all properties revealed.
Here's what a normal shape with a gradient fill would look like. You can see the start and end points when Gradient is selected and the shape transform controls:
The only way I can think of that would give you a gradient fill that didn't move with the shape would be to use some weird combination of Merge Paths and place the gradient below the Merge.