Here is the general chemical formula of the halogen addition reaction:
In the first step of the reaction, a bromine molecule approaches the electron-rich alkene carbon-carbon double bond. The bromine atom closer to the bond takes on a partial positive charge as its electrons are repelled by the electrons of the double bond. The atom is electrophilic at this time and attacks the negatively charged, high energy pi-bond portion of the alkene's carbon-carbon double bond. It forms for an instant a single sigma bond to both of the carbon atoms involved, acquiring a positive charge, which it shares slightly with the two carbon atoms. (At this moment the halogen ion is called "bromonium" or "chloronium", respectively).
When the first bromine atom attacks the carbon-carbon pi-bond, it leaves behind one of its electrons with the other bronine that it was bonded to in Br2. That other atom is now a negative bromide ion and is attracted to the slight positive charge on the Carbon atoms. It is blocked from nucleophilic attack on one side of the carbon chain by the first bromine atom and can only attack on the other side. As it attacks and forms a bond with one of the carbons, the bond between the first bromine atom and the other carbon atoms breaks, leaving each carbon with a halogen.
The two halogens always add anti to each other, forming the trans version of the molecule.