Euclid: Constraining linearly scale-independent modifications of gravity with the spectroscopic and photometric primary probes