Crystallization, Fermionization, and Cavity-Induced Phase Transitions of Bose-Einstein Condensates