Generalized Bloch-Maxwell formulation for semiconductor lasers