Any person being committed to any prison, or in the custody of any sheriff or other officer or person for any criminal or supposed criminal matter, shall not be removed therefrom into any other prison or custody, unless it is done by habeas corpus order or some other legal process or when it is expressly allowed by law. If any person removes, or causes to be removed any prisoner so committed, except as above provided, he or she shall forfeit to the party affected a sum not exceeding $300.
735 ILCS 5/10-131