An environmental group is to take legal action against Ofwat, the water regulator, accusing it of unlawfully making customers pay for decades of neglect by the water industry.