As early as possible. Article 20 of the Constitution gives an arrested person the right to consult a lawyer of choice from the time of arrest and protects the confidentiality of that consultation.
Early legal advice is particularly important before remand proceedings, statements, searches, bail/detention hearings or other significant procedural steps.