Adaptive Two-Phase Finetuning LLMs for Japanese Legal Text Retrieval