There's a standard way to define the trace (look up "Hattori-Stallings trace") that agrees with yours, but is clearly independent of choices.
For any (left) $A$-module $P$, there's a natural map $$\operatorname{Hom}_A(P,A)\otimes_AP\to\operatorname{End}_A(P),$$ sending $\varphi\otimes y$ to the endomorphism $x\mapsto\varphi(x)y$, which is an isomorphism when $P$ is finitely generated projective. Composing its inverse with the evaluation map $$\operatorname{Hom}_A(P,A)\otimes_AP\to A$$$$\operatorname{Hom}_A(P,A)\otimes_AP\to A/[A,A]$$ and theninduced by the quotientevaluation map $A\to A/[A,A]$, gives $$\operatorname{Hom}_A(P,A)\otimes_kP\to A,$$ gives the trace map $$\operatorname{Tr}_P:\operatorname{End}_A(P)\to A/[A,A].$$