Check out the UActorFactory class and example implementations of it in the engine codebase.
Essentially you need to derive from it, override one or more of its methods, then register your factory at module startup. This needs to be done from an editor module.