Do we have a data mining/analysis term for turning row values into column names and count its assigned values?
Aggregation. See Aggregate function
If you mean the part about counting values, that is indeed simply a form of "aggregation". Just call it counting even.
If you mean the part where the resulting row values become columns in the result table, then I'd say this is called "pivoting", made famous by Excel's https://en.wikipedia.org/wiki/Pivot_table though this comes up in RDBMSes in general.