Theory of electron spin alignment through nonradiative processes in naphthalene and anthracene