Learning Group Structure and Disentangled Representations of Dynamical Environments