Ferroelectric engineering: Enhanced thermoelectric performance by local structural heterogeneity