New insights into the interstellar medium of the dwarf galaxy IC 10 : connection between magnetic fields, the radio--infrared correlation and star formation