Understanding the Role of Invariance in Transfer Learning