You know, learning this wasn't the easiest thing to be honest. Its hard to explain how to do, we teach it in our class on occasion and the best way to do it is practice counting. When I was listening to a song while I was still learning I used trial and error a lot. I would tap out the beats I was hearing and plug in the dances I know. Cha cha is, in my own opinion, the easiest to spot in modern music. 1,2,3&4 is very common in music today. For rumba I listened for "quick, quick, sloooowwww". With time it becomes second nature. Also I used the classic musics to learn the beats, for instance when I wanted to learn to spot quickstep, I sat and listened to classical quicksteps for a while, till I knew what to look for. Finally I have a few sites that I used to help learn some of the basics, Ill post them for you. It's not so much a formula, its partly an art form to be able to pick the dances that can be done to a song out. Several will actually be more than one dance. Basically, to learn to do this will take several steps and a fair amount of effort, but it is well worth learning to do. :) Hope I helped.
http://www.absolutely-ballroom.com/ballroom-information.html