Centralizer construction for twisted Yangians