Detecting atomic clock frequency trends using an optimal stopping method