You can first freeze individual cloves on a baking tray and then transfer them to an airtight container. You can also mash and freeze the roasted garlic in ice cube trays. It will keep for up to 3 months.