I would hypothesize that this is strongly correlated to where a person's sense of purpose comes from. If someone gets most of their sense of purpose from their job then you would expect to see a decline once they leave their job if they can't replace it with something else. For those whose sense of purpose is derived mainly outside of work and can continue to derive that sense of purpose in retirement, I would expect less of a decline in retirement other than normal aging.