Hong Kong's leader Carrie Lam says she will formally withdraw the extradition bill that sparked months of protests in the region.