A new law forcing ministers to consult the budget watchdog on major tax and spending changes will be introduced in the Commons on Thursday.