Changing rotation axis depending on angle

Any words of advice as to how to do it with static meshes?