You need to look at all your investment as a whole. The 401K, IRA, and any taxable account need to be a part of the diversification and re-balancing. The fact you have regular deposits into the 401K needs to also be a part of your strategy.
Regardless of how much specific investments have gone up this year, you need to first determine how you want to be invested in large cap stock, small cap stock, bond, international, emerging markets...
Then you need to see where you are today compared to those investment percentages.
You then move the money in the retirement accounts to get to your desired percentage. And set the 401K deposits to be consistent with your goals. Many times the deposits are allocated the same way the balances are, but that is more complex if one of the sectors you are investing in exists completely outside the 401K.
When you re-balance in the future you will be selling sectors that grew the most and buying those that grew the least compared to their planned percentages. If all the moves are within the 401K and IRA then capital gains are not a concern.
Don't think of the different accounts as separate baskets, but think of them as a whole investment strategy.