there are many ways.... you many see a change in the quality of its coat it may stop eating/drinking it may be acting strangely (not normal behaviour) it may have a lump (usually cancer) it may becomne extremely thin or overweight
You will see a huge difference in the hampsters behavior. They might eat or drink less. They might even walk slower. They could be using the bathroom less.
Make sure your feeding the hamster right and giving it water everyday if your really unsure what to do then take your hamster to someone that knows them really well eg: vets and other places dont...