I read that in slavery you can not separate mother from children. Is it true and please provide reference.
Yes. It is sinful to cause separation between a mother and her child when performing a transaction on slaves such as sale. For example if a female slave is sold to a buyer while she is the mother of another slave owned by the seller, then the child must also be sold or gifted to the same buyer, so that the slaves can remain together. Some madhabs extrapolate the same to closely related slaves other than mothers and their children, such as siblings and even other blood relations when the parents are not present.
The evidence for this includes:
من فرق بين والدة وولدها فرق الله بينه وبين أحبته يوم القيامة
Whoever separates between a mother and her child, then Allah will separate between him and his beloved on the Day of Judgement.
لعن رسول الله ـ صلى الله عليه وسلم ـ من فرق بين الوالدة وولدها وبين الأخ وبين أخيه
The Messenger of Allah (ﷺ) cursed the one who separates a mother and her child, or a brother from his brother.
أمرني رسول الله صلى الله عليه وسلم أن أبيع غلامين أخوين فبعتهما ففرقت بينهما فذكرت ذلك للنبي صلى الله عليه وسلم فقال أدركهما فارتجعهما ولا تبعهما إلا جميعا ولا تفرق بينهما
The Messenger of Allah (ﷺ) told me to sell two slave boys who were brothers, so I sold them and separated them, I mentioned that to the Prophet (ﷺ) and he said: 'Go and take them back, and only sell them together; do not separate them.'
أجمع أهل العلم على أن التفريق بين الأم وولدها الطفل غير جائز
The people of knowledge have a consensus that it is not permitted to separate a mother from her infant child
Note however that according to most madhabs this is limited to the case when at least one of the slaves is a child (meaning underage). The restriction is lifted when both the slaves have grown up. The madhabs differ on the threshold at which the restriction is lifted, some consider it to be puberty while some set a lower limit such as the age of discernment (6-8 years) or the age when permanent teeth form - similar to the age of custody and choice when parents are divorced.
The evidence for that is:
وفيهم امرأة من بني فزارة عليها قشع من أدم - قال القشع النطع - معها ابنة لها من أحسن العرب فسقتهم حتى أتيت بهم أبا بكر فنفلني أبو بكر ابنتها فقدمنا المدينة وما كشفت لها ثوبا فلقيني رسول الله صلى الله عليه وسلم في السوق فقال " يا سلمة هب لي المرأة " . فقلت يا رسول الله والله لقد أعجبتني وما كشفت لها ثوبا ... فبعث بها رسول الله صلى الله عليه وسلم إلى أهل مكة ففدى بها ناسا من المسلمين كانوا أسروا بمكة
Among them was a woman from Banu Fazara. She was wearing a leather coat. With her was her daughter who was one of the prettiest girls in Arabia. I drove them along until I brought them to Abu Bakr who bestowed that girl upon me as a prize. So we arrived in Medina. I had not yet disrobed her when the Messenger of Allah (ﷺ) met me in the street and said: Give me that girl, O Salama. I said: Messenger of Allah, she has fascinated me. I had not yet disrobed her ...The Messenger of Allah (ﷺ) sent her to the people of Mecca, and surrendered her as ransom for a number of Muslims who had been kept as prisoners at Mecca.
The apparent meaning of this hadith is that in the distribution of the spoils of war, a mother was given to some other soldier and her daughter was first given to Salama and then sent as ransom to Mecca. Hence they were separated. The daughter was an adult as the hadith implies that she was capable of arousing and having intimacy.
نهى رسول الله - صلى الله عليه وسلم - أن يفرق بين الأم وولدها، فقيل: يا رسول الله إلى متى؟ قال: حتى يبلغ الغلام وتحيض الجارية
The Messenger of Allah ﷺ forbade causing separation between a mother and her child. I asked:"O Messenger of Allah, for how long?"
He replied: "Until a boy reaches puberty and a girl starts menstruating"
This directly defines the threshold after which separation is permitted.
كانت مارية أم إبراهيم أهداها المقوقس وأختها سيرين إلى النبي -صلى الله عليه وسلم- فاتخذ النبي -صلى الله عليه وسلم- أم إبراهيم ووهب سيرين لحسان بن ثابت
Mariah and her sister Sirin were gifted to the Prophet ﷺ by Muqawqis. So the Prophet ﷺ kept Mariah for himself and gifted Sirin to Hassan bin Thabit
In this case two adult female siblings were separated, proving that it is permissible to do so.
Because the reason for the prohibition is that a child is dependent on its blood relations for its proper upbringing and is harmed by being separated from them. However this does not apply to an adult as he or she is no longer dependent on others. Further, for example it is common practice even among free people that daughters separate from their mothers when they are married and start to live with their husbands - when that is permissible then the the same applies to sale of slaves by analogy.
Also it is permissible because of necessity. For example in the case of concubines or wives it is not lawful for one man to make a concubine or wife out of both a woman and her daughter or sister simultaneously. So it becomes necessary to cause separation between them by selling or marrying one to another person.
"The merciful are shown mercy by Ar-Rahman. Be merciful on the earth, and you will be shown mercy from Who is above the heavens. The womb is named after Ar-Rahman, so whoever connects it, Allah connects him, and whoever severs it, Allah severs him." https://sunnah.com/tirmidhi:1924