In a perfect world it shouldn't matter - if the evidence came to light during his presidency, the House and Senate would impeach and remove him and then he would immediately be handed over to a US Attorney who would prosecute him before a jury and see to it that he is convicted and locked up.
And if it came to light after his presidency, then it would go straight to the US Attorney who would prosecute him.
As a practical matter whether he would be better off having it happen during or after his presidency depends on your take on the prevailing winds.
I could see it playing out that if during his presidency overwhelming, undeniable evidence forced the House and Senate to act, that the powers that be would conclude that the humiliation of being removed from office is punishment enough for Obama and he is not thereafter brought up for criminal charges in the courts.
And if it happened after his presidency, the "let's just move on" sentiment would likely be very strong and the outcome might well be just to let it go.
And if the “let’s just move on” sentiment prevails in the House and Senate does that mean no state AG could prosecute him?