Computing relative abelian kernels of finite monoids