(a) In the civil action or proceeding in which the expenses were incurred or other amounts were paid, or
(b) To the supreme court in a separate proceeding, in which case the application shall set forth the disposition of any previous application made to any court for the same or similar relief and also reasonable cause for the failure to make application for such relief in the action or proceeding in which the expenses were incurred or other amounts were paid. 2. The application shall be made in such manner and form as may be required by the applicable rules of court or, in the absence thereof, by direction of a court to which it is made. Such application shall be upon notice to the corporation. The court may also direct that notice be given at the expense of the corporation to the stockholders and such other persons as it may designate in such manner as it may require. 3. Where indemnification is sought by judicial action, the court may allow a person such reasonable expenses, including attorneys' fees, during the pendency of the litigation as are necessary in connection with his defense therein, if the court shall find that the defendant has by his pleadings or during the course of the litigation raised genuine issues of fact or law.