Yes this is done via social welfare function. Generally the steps in almost any public policy scenario analysis that requires comparison of benefits among different people (such as optimal taxation and redistribution analysis) is :
- Assume utilities are cardinal - this is not innocuous assumption since most economists would say utility is ordinal, but without cardinal utility interpersonal utility comparisons, optimal taxation and redistribution etc are virtually futile exercises. However, you would still want to parametrize this cardinal utility in a way that it fits empirical observable facts (e.g. degree of preference between leisure and consumption etc).
- Pick some social welfare function, or whole list of social welfare function (to compare results among them). The three most popular welfare functions are:
- Rawlsian Min-Max social welfare function. Give welfare weight of 1 to the utility of the poorest members of society and 0 to everyone else.
- Utilitarian welfare function - distributes weights to individuals based on their incomes given that marginal utility of last dollar is higher for poor than for a rich. This is very similar to what the person in a link you shared does although in research proper more complex models are used.
- Chartable Conservative/Libertarian - This is basically a Rawlsian welfare function where other people than the poorest get some non-zero welfare weight as well.
You can see examples of this put in a practice in seminal works such as Saez (2001) or Diamond (1998). For example, below you can see optimal marginal tax schedule from Saez (2001) that is calculated under both Rawlsian and Utilitarian social welfare function. The excercise tells you the difference between value of \$1 for every single person not just poor vs other poor or poor vs rich but every single person vs everyone else.