Measuring labour market dynamics: an application to Spain