The UK’s world-leading climate law has had a “transformative” effect on fighting global warming, but progress is now at risk, a report warns.