Self-supervised anomaly detection for new physics