Liberal Democrats can then feel better (via recency bias) about a party that continued the Patriot Act, Gitmo, whistleblower prosecution, etc ad nauseam, while the next candidate can appeal to the moderate right that "hey, that was the last guy."
My point though was that it would be a misconception that an outgoing second term President doesn't have to weigh the impact of their decisions on future elections, even if they themselves will never run in one again. They aren't truly free to just drop whatever policies they want with no consideration for how it will impact future elections.
This one is getting done precisely because it can work with that agenda, unlike other possible policies that I'd bet, deep down inside, he has to know would also be good for the country - e.g. rescheduling marijuana or ending the war on drugs - but that would have a larger negative impact on future Democratic candidates.
Outgoing Presidents still work towards the future electability of other members of their party over the alternatives - in Obama's case, Clinton or Sanders over the Republicans. That's part of the opportunism, along with, yes, saving the more controversial unilateral actions for when they no longer need to worry about their own re-election or cooperation from Congress.