Learning to Transfer In-Hand Manipulations Using a Greedy Shape Curriculum