Maybe treat it like other professions and have a specific title be protected?
If I can build you a web application as a "web developer" but not "software engineer", you haven't accomplished anything by restricting a title. It's basically certification, similar to the Project Management Professional (PMP) title, which you can only use if you've achieved PMB certification. But people without this certification can still work in project management roles.
What could be a generic framework? Do you have any reference to standards?
Yet, both have to have medical degrees in order to be called doctors.
That you specialise after the fact doesn't really mean what you imply, not everyone who becomes a doctor can do brain surgery.