The Secretary shall pay, in advance if necessary, any court costs or other expenses incurred by the Secretary, or properly taxed against the Secretary, in any such action to which the Secretary is a party, but may charge the same, and also a reasonable amount for legal services, against the guaranteed indebtedness, or the proceeds of the sale of the security to the same extent as the holder (see ?