In the wild, female livebearers hang out in large groups consisting of between 20 & 50 (but sometimes up to 100 or more) females. These groups have a pecking order with the biggest most dominant female ruling the group and she has a group of girlfriends who back her up. All the other females live in the group but are lower down the pecking order.
The groups of females move around rivers and waterways looking for food and places to hang out. As the groups move around a few males follow the group and try to breed with any females. The groups of males have a pecking order too and the biggest male will bully his smaller mates.
In the confines of an aquarium, the males will constantly harass the females and try to breed with them. This puts undue stress on the females and if there are too many males constantly pestering the females, the females can get sick and die.
It is preferable to keep livebearers in single sex tanks (either male or female but not both sexes together). If you want a group of males and females then have 1 male and at least 6 females (preferably 10 or more females per male).
Female livebearers can carry up to 6 sperm packets from breeding with males and they use 1 sperm packet to fertilise each batch of eggs. The gestation period (from the time she fertilises the eggs to when she gives birth to free swimming babies) is about 1 month. After which she will fertilise another batch of eggs using another sperm packet. This allows female livebearers to produce young about once a month for up to 6 months without any males being present.
If you want to breed livebearers for specific colours, then have a tank with females and let them give birth and use up all the sperm packets they are carrying in their body. Give them a few months without being pregnant and then add a male to the tank for a week before moving him out, or move the female/s into a tank with a male for a week and let them breed. Then move the females back into their own tank.
The above information applies to most livebearers but female swordtails can turn into males if there is no male present for a long time. If you have a group of female swordtails and they use up all their sperm packets, and there is no male around, the dominant female will turn into a male and start breeding with the other females.
-------------
It is preferable not to move pregnant fish because you can stress them and even damage the unborn fry. If you have to move pregnant females, carefully catch them in a net and then use a plastic container to scoop the female and net up in some tank water. Move her (in the net in the bucket of water) to a new tank and then carefully pour her into the new tank.
If you move the female into a smaller aquarium that would stress her.
If you use completely new water in the new tank it would stress her. If you set up a new tank for her you should fill the new tank with water from her current tank, so the water is exactly the same.
If the new tank does not have any plants in it will stress her. Put some plants in with her. Water Sprite (Ceratopteris thalictroides/ cornuta) is the best plant for livebearers. It normally grows on the surface but can also be grown in the substrate where it grows into a lovely light green shrub.
If you don't have any live plants then add a heap of artificial plants to provide her with shelter when she goes into labour, and to give the fry somewhere to hide when they are born.
Make sure the new tank has an established filter in it so the water stays clean.
Do not put the female into a tank with males until at least 1 week after she has given birth otherwise the male/s will stress her out.
Try not to move the female for at least 1 week after she has given birth so she can heal up. If you have to move the female after she has given birth, use the method above for moving pregnant females.
Most female mollies do not eat their young if the female is well fed and there are plants in the tank, but will eat them when they are confined to a small breeding trap.