Understanding the radio relic emission in the galaxy cluster MACS J0717.5+3745: Spectral analysis