A doctor in Spain has been convicted of endangering the lives of elite cyclists by administering blood transfusions to increase performance.