In-Distribution and Out-of-Distribution Self-Supervised ECG Representation Learning For Arrhythmia Detection