Explainable machine learning for magnetic interactions extraction