A nonequilibrium thermodynamics approach to the transient properties of hydrogels