Prosecutors have charged two Taiwanese nationals with carrying out espionage on behalf of China, one of them a former Cabinet employee.