How do I keep a pattern overlay layer effect from moving around separately when animating?
Delete any motion or rotation keyframes in the overlay layer. Now line it up with the gear layer as you want, then make the gear layer the parent for the pattern layer.

To set a layer's parent you need to have the parent column visible in the timeline window. If it's not visible, right-click the column headings and choose it from the list. In the parent column you can then use the drop down to select the layer's parent or drag the pick-whip (the little spiral widget) to the chosen layer.