Degrees of freedom for off-the-grid sparse estimation