Gravitational Phase Transition of Fermionic Matter in a General-Relativistic Framework