Manually. Companies like Stats(that also now running the optical tracking in the nba) has rooms full of people watching videos of games and tagging events.
I know a lot of guys that work at stats. Some of it is manual but over the last couple years they have actually build some pretty cool stuff to track all this. The company has done three rounds of massive layoffs over the last year though so who knows if advancements will continue.