The UK government's legal chief says Johnson's government will not break a law passed by opposition members of Parliament to delay Brexit.