“Learn the dance” means learning how things are done in certain situations and going along with it. Learn the rules would have about the same meaning, but, it is a bit more like learning the rules and going along with the situation to get what you want. “Playing the game” would be very similar.