Character slowing down/breaking animation

Hi! The question is - a lot of modern games use an animation for the character slowing down, I mean like the player is runnning and at the end of the run he starts “breaking”, to slow down, not just simply transitioning from run to idle. How should I set up variables to make this kind of transition? To make it work only on slowing down and not appear on acceleration.