Invariance is Key to Generalization: Examining the Role of Representation in Sim-to-Real Transfer for Visual Navigation