Is it brake related or trani?

My car will run fine for a few minutes then it will act like it's in neutral and the brake pedal gets real hard to push. Let the car sit for a few and it will run ok, then it will repeat problem again

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0