It's possible that he is stressed. A larger tank is a good thing but if it's inadequately decorated it can cause bettas stress. They're pretty small and in the wild would probably avoid wide, open areas of water or get eaten. So some bettas tend to shy away from the open areas of a tank. You can try filling in some of the open areas with decor or plants and see if that helps. Try to be sure that he has a "cave" or some place that he can hide.
On another note, it is a small tank and ammonia can build up fast. Have you checked your parameters recently? A tank that size will need a minimum of two 50% water changes to keep it in the safe limits. If you're already doing that and parameters are good (ammonia should always be 0, if it hits .5 change 50% and retest an hour later) then it's likely something else.
There are a LOT of things that can make a betta stop eating. If he has any other symptoms (lethargy, grey belly, bloated belly, trouble swimming, etc) that will help narrow down what's going on. I don't think the change from a half gallon to a 2.5g would cause that much stress though.