What is the primary function of a Transportation Management System (TMS) in a shipper's or third-party logistics provider's supply chain operations?