Optimizing earthquake nowcasting with machine learning: the role of strain hardening in the earthquake cycle