Many ways to do it, but a common method is when the player crouches or un-crouches, Lerp the height of the capsule component somewhat in sync with the animation.
It will be additional states in your character, something like: walking >> crouching >> crouched > uncrouching >> walking.