I was in this exact position several years ago...
Before I start, clearly I only have limited information to work from at this stage so I am making some assumptions, however hopefully this will help you develop your thoughts.
To my mind, this can be split into two distinct considerations.
1. Financial and business considerations
You mention that the potential buyer wants to keep you on with the business, would then still be interested in the purchase if you are not willing to stay? Would the offer the same price? If not, are there any other buyers that may be interested on terms that better suit you?
Every situation is different however many businesses - even large ones - are very reliant on their key owners and managers. Because of this they struggle to find a buyer, or buyers may want to pay less as they perceive a risk with a change in key personnel.
This is especially true if the business is a service business and/or the business has been build based on the drive and relationship of the key stakeholder(s) - i.e. you.
If that is the case then it may limit your options regarding a clean break immediately after sale.
2. Personal considerations
It's certainly right that your relationship with the business would be different after a sale, however whether that is something that you may be able to accommodate - or even like or prefer - is down to you.
Do you think you would get on with the new owners? Do you have a similar outlook and approach or is their style different?
If you do have new project(s) that you'd like to move on to then perhaps explore with the buyers if there's a middle ground. Could your time be split? Or could you be engaged on a consultancy basis? Perhaps a full-time handover would work on a temporary basis before reducing this down at an agreed point.
I hope this helps. Very happy to discuss your particular situation - and explain more about my experience - on a call if that would be helpful.