It is well-known that number of pairs of commuting elements in finite group G is equal to number of conjugacy classes multiplied by cardinality of G. More generally here (MO275769) Qiaochu Yuan explains that it can be generalized:
Claim: Let $\pi$ be a finitely generated group and $G$ be a finite group. Then
$$\frac{|\text{Hom}(\pi \times \mathbb{Z}, G)|}{|G|}$$
is equal to the number of conjugacy classes of homomorphisms $\pi \to G$.
(Taking $\pi = \mathbb{Z} $ one obtains initial claim.) Here on MO Benjamin Steinberg provided nice proof based on Cauchy-Frobenius-Burnside orbit counting lemma.
Question: Is there any generalization of these relations to monoids/semigroups? In particular to a semigroup of ALL (non-necessarily non-degenerate) matrices over finite field $F_q$ ? Or for $G$ - ALL (non-necessarily bijective) maps of finite set to itself ? (The later is a kind of "field with one element" version of the previous).
Remark: If one counts pairs of elements: one from monoid another from group - then answer is positive - Benjamin Steinberg here on MO. However positive news may be finished here.
Remark: Commuting pairs for ALL (non-necessarily non-degenerate) matrices has been widely studied - the so-called "commuting variety", in particular there is nice generating function for such pairs due to Feit and Fine see e.g. MO271752.
Remark: I vaguely remember Benjamin Steinberg some years ago explained here on MO that there can be several definitions of "conjugacy classes" for semigroups, cannot find that post now. There is a paper on that arxiv1503 (thanks to David A. Jackson). So it might work for some and may not work for others.
Example no-go?: Let us look on 2x2 matrices over $F_q$: the number of commuting pairs seems to be $p^2(p^4+p^3-p)$, semigroup cardinality is $p^4$, group cardinality $(p^2-1)(p^2-p)$, number of "conjugacy classes" defined as conjugated with respect to GROUP (i.e. part of invertible elements) is $p^2+p$. So
$$p^2(p^4+p^3-p) \ne (p^2-1)(p^2-p) * (p^2+p ) ~~ \text{group cardinality used} $$ $$p^2(p^4+p^3-p) \ne (p^4) * (p^2+p ) ~~ \text{semigroup cardinality used}$$
So if I am not making mistake somewhere (for example incorrectly quoting number of commuting pairs or "conjugacy classes"), then - naively it might not work, it is a pity if would be so.
PS
On count of conjugacy classes - quote from Steven Sam blog:
As an aside, if we look at the conjugacy classes of all matrices instead of invertible matrices, i.e., we allow the domain of the partition valued functions above to include the polynomial x, then the number of such classes is \sum_j p_j(n) q^j where p_j(n) is the number of partitions of n into j parts. I think it’s a really nice formula (though it takes some work to show). See Chapter 1, Section 10 of the second edition of Enumerative Combinatorics I for a derivation of this formula.
So $p^2+p$ for $n=2$, $p$ - classes of scalar matrices, $p^2$ with "full" "Frobenius cell" (i.e. [[0,1],[,]]).
Further no-go examples 3x3 commuting pairs of matrices: $p^{12}+p^{11}+2p^{10}-2p^8-2p^7+p^5 $ - not factorizable. In comments Benjamin Steinberg provided examples of semigroups where number of commuting elements is not factorizable in product.
So to conclude: it seems easy factorization of number of commuting pairs to anything is impossible for even simple monoids. So the only hope might be some more complicated summation of products like cardinality of some subgroups multiplied on cardinality some conjugacy classes, where summation over some filtration - how far elements are from the invertible ones.