AnyLoss: Transforming Classification Metrics into Loss Functions