Edit 1: if an object is already created in Mendix I don't know a way to change it directly to a another type. You can create the new object, copy attributes and delete the old one.
old incorrect answer :
Inheritance split https://world.mendix.com/display/refguide5/Inheritance+Split
If you want to change an object of type workspace to an object of type account, you can find your answer in this thread.
Sorry if I misread your question, but do you mean that you would like to delete the workspace object but keep the account object? Since workspace is a generalisation of account you should create a new account object and copy the account fields from workspace to the new account object and delete the workspace object. You can not transform the workspace object back to only a account object.
If I misread the question you may want to clarify what you want to achieve here.
Regards,
Ronald
For a custom login action, we used the following, where user is a System.User obect and NatuurlijkPersoon is a specialization.
if (user.getMendixObject().getType().equals(NatuurlijkPersoon.getType())) {
NatuurlijkPersoon persoon = NatuurlijkPersoon.initialize(getContext(), user.getMendixObject());