Melt 1/2 of the ghee in a nonstick skillet over medium-low heat. Add onion; spread out into a thin layer. Cook, stirring occasionally, until soft and beginning to brown, 8 to 10 minutes. Reduce heat if it's browning too quickly; do not allow to burn. Add garlic; cook and stir until fragrant, about 1 minute. Stir in vinegar.