How to increase speed when moving in one direction after set amount of time?

Hi im trying to make an objects speed increase slightly when left moving in one direction after say 2 3 seconds it will then revert back to original speed when direction is changed? it may be simple but having hard time trying to do the math.

Think Im a missile il move forward/up after 3 seconds my speed will increase but if i suddenly change direction my speed reverts back to say start speed which is 1. Not asking for the code just a hint or something to set me on right track as this is a massive part of the gameplay im going for as simple as it may sound.

Never done something like that, but I think it would work like this:
Monitor the change in rotation. If there’s no change in rotation for a specific time, then increase the speed/thrust value over a specific time. If there is change in rotation, then decrease the speed/thrust over a specific time.

You could do the acceleration part with Rigidbody.AddForce(), or just change the position over time directly.

Greets!