He was an oficer in the Royal Navy (presuming he's Nritish) and has trained within the Navy as an engineer officer. The RN has a thriving and essential Engineering Branch and the officers wear thin purple rings between their rank marking rings on their sleeves.
It means that that is what he had taken training to do, and probably has a qualification in, the implication being that he is now doing something else, eg I am an occupational therapist by training, but my most recent job has been in software development.