is it better to correlate and encode or encode and correlate?
Correlation is for continuous variables, example Pearson co-relation. Using Pearson correlation for categorical or ordinal variables are not recommended. If you are encoding the data, i can imply that it is a categorical variable.
For categorical variables you can find association between the variables (instead of correlation) using Chi-squared test of independence. This test is quite lenient , in the sense, even for a weak association it will show a low p-value. To further validate the result of Chi-squared test of independence , you can calculate Crammers V-test which will give a specific value between 0 and 1 . The analysis gets easy with Crammers V-test. Crammers V-test uses Chi distribution.
Whether you calculate association before or after the encoding (for categorical variable) it will not make any difference because it works on the frequency table rather than the actual values of the column