Gravar-mail: A generalized linear response framework for expanded ensemble and replica exchange simulations