You may read Prof. Maxwell's writings for yourself at
https://ia600209.us.archive.org/28/items/electricandmagne01maxwrich/electricandmagne01maxwrich.pdf on page 3. In Adobe Acrobat it is page 42.
The relevant passage is
In descriptive astronomy the mass of the sun or that of the
earth is sometimes taken as a unit, but in the dynamical theory
of astronomy the unit of mass is deduced from the units of time
and length, combined with the fact of universal gravitation. The
astronomical unit of mass is that mass which attracts another
body placed at the unit of distance so as to produce in that body
the unit of acceleration.
In framing a universal system of units we may either deduce
the unit of mass in this way from those of length and time
already defined, and this we can do to a rough approximation in
the present state of science ; or, if we expect soon to be able to
determine the mass of a single molecule of a standard substance,
we may wait for this determination before fixing a universal
standard of mass.
We shall denote the concrete unit of mass by the symbol M
in treating of the dimensions of other units. The unit of mass
will be taken as one of the three fundamental units. When, as
in the French system, a particular substance, water, is taken as
a standard of density, then the unit of mass is no longer independent, but varies as the unit of volume, or as L^3.
If, as in the astronomical system, the unit of mass is defined
with respect to its attractive power, the dimensions of M are
(L^3*T^-2).
For the acceleration due to the attraction of a mass m at a
distance r is by the Newtonian Law m/r^2 . Suppose this attraction
to act for a very small time t on a body originally at rest, and to
cause it to describe a space s, then by the formula of Galileo, s = mt^2/2r^2 whence m = 2r^2s/t^2. Since r and s are both lengths, and t is a time, this equation cannot be true unless the dimensions of m are(L^3*T^-2). The same can be shewn from any astronomical equation in which the mass of a body appears in some but not in all of the terms f.