This is a thing I have been thinking on and gotten a bit frustrated so I share my thoughts here in hope for clarification.
Let $M$ be a magma, that is a set with an underlying binary operation which we denote $\cdot$. The binary operation is not necessarily associative, that is we do not necessarily have $$a\cdot (b\cdot c)=(a\cdot b)\cdot c$$ Here is the issue at hand, in group theory we can "make" a group abelian by taking the quotient with its commutator subgrouop, $G/[G,G]$, which is abelian, I am wondering if there is something similar for magmas but for associativity.
Of course having dealt with universal algebra, semirings and semigroups (which is the target here in a way) what I need to work with is a relation, more specificly a congruence relation so I figured I would start defining it as such. So I started by saying that $e \mathrel{R} f$, or $(e,f)\in R$, if there exists some $a,b,c\in M$ such that $(a\cdot b)\cdot c = e$ and $a\cdot (b\cdot c) = f$, seemed like a good place to start for me in my quest, only that I realized that there is not necessarily a unit in a magma so we do not have $x \mathrel{R} x$ which is a requirement, well let's just throw those in too then I thought. Which is the reflexive closure of $R$, that is $\text{Cl}_\text{ref}(R)$ from before.
Next I thought about transitivity which is required and I got absolutely nowhere there in my attempts primarily because I could not find anyway to proceed after setting up the equalities with elements and all. I pretty much felt it was impossible so I figured "Let's just do the congruence closure and call it a day" $\text{Cl}_\text{cng}(R)$. Which would of course be a congruence by the very definition but I feel it's a bit "cheap" so to speak. And quite frankly I am not entirely certain that it will yield satisfactory results. So the question is more "is there a way to make a magma associative that is better than this?".