"I recused myself not because of any asserted wrongdoing on my part during the campaign," Sessions said. "But because a Department of Justice regulation, 28 CFR 45.2, required it.""That regulation states, in effect, that department employees should not participate in investigations of a campaign if they have served as a campaign advisor," said Sessions.
28 CFR 45.2 - Disqualification arising from personal or political relationship. <- Link
It clearly deals with avoiding a conflict of interest by people participating in a criminal investigation.
I've got no experience with the law, but it seems to read that he could have just reported that he had a personal and political relationship with Trump and his campaign, and then waited for his supervisor to "relieve him from participation" if that supervisor couldn't determine that he could be impartial.