Tā yánzhèng de gàosu wǒmen, zhè zhǒng xíngwéi bùnéng zài fāshēng.
He sternly told us that such behavior must not happen again.
Tips
register
严正 is formal and primarily diplomatic / official-statement vocabulary. The phrase 严正抗议 ('stern protest') and 严正声明 ('solemn declaration') are extremely common in Chinese government communiqués. Don't use it for everyday strictness — use 严肃 (yánsù) instead.
memory
Compose meaning from parts: 严 'strict' + 正 'upright/just' = 'sternly upright' — the tone of a moral high-ground rebuke.