rotate character parts in different direction

I have a character which controlled by two sticks - one stick for direct movement and another stick fo strafe. For strafe I want upper part of character to save existing rotation, and for lower part I want to make rotation in direction of movement. This is shown on the picture: character rotated to left-down and move down, so I need to rotate his legs in appropriate direction. Is it way do it in Unity3d? I do not even know where to start.

Perhaps you should look at Unity Mecanim Animation Tutorial