The principal dancer will give his final performance October 18, with a program he curated.