You are mapping form a 3 dimensional space to a 3 dimensional space (actually P2 to itself but using different bases so you are treating P2 as two different spaces) so you want a 3 by 3 matrix.
Any vector in P2 is of the form ux^2+ vx+ w so can be written as u(1)+ v(x)+ w(x^2) where I have put parentheses to show the basis vectors. Changing to basis b would mean finding numbers p, q, and r so that ux^2+ vx+ w= p(-2 - 2x + 3x^2)+ q(1 + 2x - x^2)+ r(-1 - x + 2x^2).
The simplest way to find the transition matrix is to determine how to write each of the vectors in basis a in terms of basis b and use those coefficients as columns in the matrix.
For example, the first vector in basis a is "1" so we want to find p, q, and r such that
1= p(-2 - 2x + 3x^2)+ q(1 + 2x - x^2)+ r(-1 - x + 2x^2). That is the same as
1= -2p- 3px+ 3px^2+ q+ 2qx- qx^2- r- rx+ 2rx^2= (-2p +q- r)+ (-3p+ 2q- r)x+ (3p- q+ 2r)x^2. For that to be true for all x we must have -2p+ q- r= 1, -3p+ 2q- r= 0, and 3p- q+ 2r= 0. Solve those three equations for p, q, and r.