A scaling law to determine phase morphologies during ion intercalation