Changes in the environmental, social and governance (ESG) ratings of a firm can have "long-lasting effects" on stock returns, according to academic research.