A general method for proving sharp energy decay rates for memory-dissipative evolution equations