It's calling SkeletonBaker.GenerateMecanimAnimationClips(), you can see the code here. Note however that this is an Editor class method which is called, so you cannot easily copy the code and paste it in a runtime script. What are you trying to achieve?