Thermodynamic Theory of Relaxation Phenomena