It depends on how old the map is.
A possible answer to the methodology of "how" vis-a-vis ethnicity.
The USSR recorded everyone's ethnicity in their internal IDs. They were also recorded in all internal school and work records. I don't believe these records are still used.
However, it obviously made statistical determinations about ethnic breakdown much more trivial. While there is flux over the years, most people don't move that much. The amount of moving can also be estimated based on birth/death records and population numbers. Even college students usually study in the cities in which they grow up.
A possible answer to the methodology of "how" vis-a-vis language is that there are a lot of statistical markers for language consumption.
Newspaper, book and other media sales are good indicators.
Just as a side note, the map is also somewhat lacking. The West Ukrainian population is a mix of ethnic Poles and ethnic Ukrainians. And the language is a mix of both. Native Ukrainian speakers often report having a difficult time understand the Western Ukrainian dialect. The few times that I personally had to encounter it, I found it easier to understand than the proper Ukrainian. It could be because my Ukrainian is somewhat weak and the mountain Ukrainians (because the West is mostly mountains) are forced to use a lot of English-based neologisms. I really can't tell why, to be honest.
The map also doesn't include ethnic Crimean Tatars who were force-removed from Crimea to the Asian regions of the USSR during Stalin's rule. Ukraine, after becoming an independent state, invited them to return. They have their own language and they are ethnically closer to Turks than to any Slavic ethnicity. In Ukraine, they are considered to be the native population of Crimea. Tragically, after the Russian Federation occupied Crimea in 2014, it compounded Stalin's legacy by forcefully removing the Crimean Tatars again. Crimea is not that big a region (it's roughly a 70mix70mi square). So influx or expulsion of the native population could change the demographic quite a bit.