Assessing and enhancing system-level safety in learning-enabled cyber-physical systems