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)][1] 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.)

**Question:** Is there any generalization of these relations to semigroups $G$ ? 
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:** 
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][2]. 

**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. 
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 ) ~~ group ~ cardinality ~ used $$ 
$$p^2(p^4+p^3-p) \ne  (p^4) * (p^2+p )  ~~ 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.

  [1]: https://mathoverflow.net/a/275769/10446
  [2]: https://mathoverflow.net/q/271752/10446