Transform Orientation Locked to Mesh

How do you lock the xy axis of a mesh to a mesh so it can also move forward based on an axis no matter which direction it’s pointed?

In other words, If I have a boat that is aligned in the x axis and I have it moving forward, and I rotate the mesh of the boat, how do I get the x axis to follow the orientation of the boat/mesh?