I have a connecting flight from Hamburg through Frankfurt with Lufthansa. I have only 45 minutes to catch the other flight. Usually when the check-in is done in person, I can say that I have a connecting flight and that I would like my luggage to be transferred without collecting it. But I know that in Hamburg the check-in is done using a machine (and I am not sure if there is the option of using the traditional way). I am worried that I will not be able to specify to the machine that I have a connecting flight and that would need to re-check my luggage, as 45 minutes would not be enough in this case. Any suggestion?
If it's a single booking, your bags will automatically checked through to your final destination. You should be getting the boarding passes of both flights in Hamburg from the Kiosk and the baggage tag should show your final destination.
See https://www.lufthansa.com/de/en/Checking-in-baggage for baggage drop off instruction in Hamburg
More info on using a check in machine: https://www.lufthansa.com/us/en/check-in-machine. You need proper ID for the process.
If your flights are on a single booking, check-in kiosks will generally always print baggage tags that route your bags through to your final destination.
You can check before you attach the tag to your bag that it shows the airport code for your final destination in large letters. If it doesn't, seek help to have it retagged from the airline staff that are always present near the kiosk to help travelers.