Operational techniques for Laguerre and Legendre polynomials