Estimating the degree of non-Markovianity using variational quantum circuits