I can't remember exactly how it works in Sonic, but one way to get a character to have a sliding animation is to check like this:
Right Arrow is down
Player.Platform.VectorX < 0
Set animation to Slide
Left Arrow is down
Player.Platform.VectorX > 0
Set animation to Slide
If you want it to be more specific, such as only sliding while turning at VERY high speeds, simply modify the 0 in both of those checks to whatever you want it to be. Just remember that when you're heading left, VectorX is negative.