Retroactivity and Legal Change: An Equilibrium Approach