Towards Domain Generalization for ECG and EEG Classification: Algorithms and Benchmarks