We did this and had to give the MX an IP in the same VLAN and then gradually switched the L3 routes to point to the MX IP instead of the ASA IP.
Note MX will need an upstream connection to the internet(s) and a downstream connection to your core switch so the routes can find the MX. I'm also assuming your L3 routes live on the core switches. If they live on the ASAs it could make this more complex.
Adam R MS | CISSP, CISM, VCP, MCITP, CCNP, ITILv3, CMNO
If this was helpful click the Kudo button below
If my reply solved your issue, please mark it as a solution.