Thermodynamic formulation of flowing soft matter with transient forces