A key Treasury adviser has resigned his role at the FSA over claims he knew HBOS was in trouble when he was chief executive at the bank.