Someone who's resigning from a position but is willing to continue on a consulting or freelance basis can lay out the options in this letter.
With this letter, I tender my resignation.
While I will no longer be an employee of ABC Corp., I'd like to reiterate my willingness to serve as an independent contractor if you find yourself in continued need of my service. I have worked as a consultant in the past and am very comfortable in that role.
I have enjoyed my time with ABC Corp. and look forward to the possibility of future opportunities with the company.