Calculating proper vector

I’m writing code to a spaceship that maintains its inertia even after you stop applying force. I.E. the ship continues to rotate if you’ve applied rotational force, or the ship continues to strafe if you’ve applied lateral force.

I’ve the rotational and strafe inertia down (using transform.up), but for the life of me, I can’t figure out how to maintain the proper vector after the player turns the engine off and rotates the ship.

So if the player is moving up and stops the engine and rotates the ship, the ship should still be moving up.

Can someone point me in the right direction?

Is the issue that you know the velocity relative to the transform, but you need the velocity from the worldSpace point of view? Would Transform.TransformDirection help?