Ferroelectric transistor memory arrays on flexible foils